package chapter_seventeen.text246;

/**
 * Data time:2021/11/8 16:16
 * StudentID:2019112118
 * Author:hgw
 * Description: 充当请求发送者
 */
public class CalculatorForm {
    public AbstractCommand command;

    public void setCommand(AbstractCommand command) {
        this.command = command;
    }

    //调用命令对象的 execute()方法执行运算
    public void compute(int value){
        int i = command.execute(value);
        System.out.println("执行运算，运算结果为:" + i);
    }


}
